package com.guoranhao.business.enums;

import org.apache.commons.lang.StringUtils;

/**
 * Description: 用户中心渠道枚举
 * All Rights Reserved.
 * @version 1.0  2016年12月19日 下午12:03:32  by 代鹏（daipeng.456@gmail.com）创建
 */
public enum ChannelInfoEnum {
	
	LLB_INNER(1L, "菱菱邦站内", "llb", "llb"),
	LLB_WULING_DEALER(2L, "五菱经销商", "wl_dealer", "llb"),
	LLB_WX_PUBLIC(3L, "菱菱邦微信公众号", "wx_public", "llb"),
	LLB_INNER_ADMIN(4L, "菱菱邦管理后台", "llb_admin", "llb_admin"),
	LLB_WEB_POST(5L, "Web端发帖", "web_post", "web_post"),
	LLB_BJ_CARD730(6L, "宝骏730焕新卡活动", "bj_card_730", "llb"),
	LLB_WX_SMALL(7L, "菱菱邦微信小程序", "wx_small", "llb"),
	LLB_WANLE_XINGQIU(8L, "玩乐星球", "wanle_xingqiu", "llb"),
	LLB_BJ_DOUBLE_GIFT(9L, "感恩宝骏双重好礼", "bj_double_gift", "llb"),
	LLB_BJ_310_W(10L, "宝骏头条你来代言(宝骏310w)", "bj_310w", "llb"),
	LLB_WLBJ_BAOYANG(11L, "五菱宝骏养护节,乐驾无忧送好礼", "wlbj_baoyang", "llb"),
	LLB_WX_TURNTABLE(12L, "微信幸运赚不停", "wx_turntable", "llb"),
	LLB_XFH_TURNTABLE(13L, "喜福会大转盘", "xfh_turntable", "llb"),
	LLB_SALESASSISTANT(15L, "销售助手", "wl_salesassistant", "llb"),
	LLB_WX_LCHT(16L, "微信拉新活动", "wx_lcht", "llb"),
    LLB_WX_WORLD_CUP(17L, "微信世界杯竞猜", "wx_world_cup", "llb"),
	LLB_MINIPROGRAM_MALL(18L, "菱菱邦电商微信小程序", "MiniProgram_MALL", "llb"),
	LLB_LOGISTICS_MEILIDAOJIA(19L, "物流对接-好仓管云仓储", "logistics_meilidaojia", "llb"),
	LLB_LOGISTICS_KDNIAO(20L, "物流对接-快递鸟", "logistics_kdniao", "llb"),
	LLB_SHARE(22L, "端外分享渠道", "llb_share", "llb"),
	LLB_OPEN_API(23L, "第三方授权登录", "llb_open_api", "llb"),
    LLB_WEB_MALL(25L,"PC WEB商城","llb_web_mall","llb"),
    LLB_XFH_WZFL(26L,"喜福会 玩转福礼","xfh_wzfl","llb"),

	;
	
	private Long channeInfoId;//主键id
	private String channelName;//渠道描述
	private String platform;//平台类型:llb,weixin,qq,weibo
	private String appClient;//客户端类型:llb,llb_shop
	
	private ChannelInfoEnum(Long channeInfoId, String channelName, String platform, String appClient) {
		this.channeInfoId = channeInfoId;
		this.channelName = channelName;
		this.platform = platform;
		this.appClient = appClient;
	}
	public Long getChanneInfoId() {
		return channeInfoId;
	}
	public void setChanneInfoId(Long channeInfoId) {
		this.channeInfoId = channeInfoId;
	}
	public String getChannelName() {
		return channelName;
	}
	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}
	public String getPlatform() {
		return platform;
	}
	public void setPlatform(String platform) {
		this.platform = platform;
	}
	public String getAppClient() {
		return appClient;
	}
	public void setAppClient(String appClient) {
		this.appClient = appClient;
	}
	
	public static ChannelInfoEnum getChannelInfoEnumById(Long id){
		if(null != id){
			for(ChannelInfoEnum item:ChannelInfoEnum.values()){
				if(item.getChanneInfoId().longValue() == id){
					return item;
				}
			}
		}
		return null;
	}
	
	public static String getPlatformEnumById(Long id){
		if(null != id){
			for(ChannelInfoEnum item:ChannelInfoEnum.values()){
				if(item.getChanneInfoId().longValue() == id){
					return item.getPlatform();
				}
			}
		}
		return null;
	}
	
	public static ChannelInfoEnum getChannelInfoEnumByPfAndAppClient(String pf, String appClient){
		if(StringUtils.isNotBlank(pf) && StringUtils.isNotBlank(appClient)){
			for(ChannelInfoEnum item:ChannelInfoEnum.values()){
				if(item.getPlatform().equals(pf) && item.getAppClient().equals(appClient)){
					return item;
				}
			}
		}
		return null;
	}
}